﻿using System;
using System.Windows.Forms;

namespace 屏蔽键盘输入
{
    public partial class Form1 : Form
    {
        HookHelper hook = new HookHelper();
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                hook.Hook_Start();
                button1.Enabled = false;
                button2.Enabled = true;
            }
            catch(Exception ex)
            {
                MessageBox.Show(ex.Message);
                button1.Enabled = true;
                button2.Enabled = false;
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                hook.Hook_Clear();
                button1.Enabled = true;
                button2.Enabled = false;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
    }
}
